home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / d / digitaorg96pluspack.dms / digitaorg96pluspack.adf / Install 96 Plus Pack < prev    next >
Text File  |  1995-12-12  |  10KB  |  420 lines

  1. ; Install Organiser 96 Plus Pack
  2. ; 1/11/95 by Mark Jackson
  3.  
  4. ; $VER: 1.1
  5.  
  6. ;-------------------
  7. ; String definitions
  8. ;-------------------
  9.  
  10. (set #Welcome-Message
  11. (cat "\n\nWelcome to the \"Organiser 96 Plus Pack\" Installer\n\n\n"
  12.     "Copyright (C) 1995 Digita International."
  13. ))
  14.  
  15. (set #InsertDiskMsg (cat "\nPlease insert the disk labelled\n\n\""))
  16.  
  17. (set #DiskHelp
  18.     (cat "\n    If you know that the correct disk is in the drive, but you still cannot proceed, "
  19.         "then the name of the disk is incorrect.\n"
  20.         "    Ensure that the disk name is not preceded by 'copy_of_', or blank spaces before or after the disk name.\n\n\n" @askdisk-help
  21.     )
  22. )
  23.  
  24. (set #BlankDiskWarning
  25.     (cat "\nPlease insert a 'blank' disk in the internal\n"
  26.         "disk drive and click \"Proceed\" when ready."
  27.         "\n\nWARNING: This procedure will destroy all information "
  28.         "that may already be on the disk."
  29.     )
  30. )
  31.  
  32. (set #FloppyWarningHelp
  33.     (cat     "\nThis procedure uses the 'Format' command to "
  34.         "wipe and prepare the disk in the internal disk drive."
  35.         "\n\nWrite-protect your master disk before making a "
  36.         "backup copy and keep it in a safe place."
  37.         "\n\nEnsure the blank disk you insert to be formatted "
  38.         "is write-enabled before clicking the \"Proceed\" button."
  39.     )
  40. )
  41.  
  42. (set #FormatWorkingMsgQuick "Please wait...\n\nQuick Formatting a disk.")
  43.  
  44. (set #FormatWorkingMsgSlow "Please wait...\n\nSlow Formatting a disk.")
  45.  
  46. (set #FormatError
  47.     (cat     "\nAn error occured when trying to format this disk.\n\n"
  48.         "Please ensure that the disk is in the disk drive "
  49.         "before you click the \"Proceed\" button or "
  50.         "put another disk in the drive and try again."
  51.     )
  52. )
  53.  
  54. (set #FormatCompleteMsg1
  55.     (cat " created.\n\nPlease take out the disk "
  56.         "in the internal disk drive and label it \""
  57.     )
  58. )
  59.  
  60. (set #FormatCompleteMsg2
  61.     (cat "\", then click the \"Proceed\" button.")
  62. )
  63.  
  64. (set #DestChoicePrompt "\n\nWhere do you have the Organiser program installed?")
  65.  
  66. (set #FloppyChoiceMsg "On floppy disks")
  67. (set #HardDiskChoiceMsg "On a hard disk")
  68.  
  69. (set #DestChoiceHelp
  70.     (cat "\nSelect the radio button \"On a hard disk\" to "
  71.         "install the Organiser 96 Plus Pack onto your hard disk.\n\n"
  72.         "Select the radio button \"On floppy disks\" to "
  73.         "install the Organiser 96 Plus Pack onto a set of floppy disks.\n\n\n"
  74.     )
  75. )
  76.  
  77. (set #HardDiskDestChoiceMsg
  78.     (cat "\nPlease select the \"Organiser\" drawer on your hard disk, then click the \"Proceed\" button:")
  79. )
  80.  
  81. (set #HardDiskDestChoiceHelp
  82.     (cat    "You should select the \"Organiser\" drawer on your "
  83.         "hard disk, not where the \"Organiser\" drawer is located."
  84.         "\n\nTwo new drawers called \"96 Plus Pack Themes\" and "
  85.         "\"96 Plus Pack Supplements\" will be created in the "
  86.         "\"Organiser\" drawer, and the Diary Themes and Supplements "
  87.         "will be put in these drawers.\n\nFor more information on "
  88.         "using Diary Themes and Supplements with Organiser, refer "
  89.         "to the Organiser manual, or Organiser's on-line help system."
  90.     )
  91. )
  92.  
  93. (set #ArchiveAbortMsg1 "\n\nThere was a problem when trying to dearchive \n\n\"")
  94.  
  95. (set @default-dest "")
  96.  
  97.  
  98. ;--------------------------------
  99. ; Procedures...
  100. ;--------------------------------
  101.  
  102. (Procedure @UnpackFiles
  103.     (
  104.         (working (cat "\n\nPlease wait...\n\nUnarchiving " #ArchiveType))
  105.  
  106.             (set ExpandName #UnpackFile)
  107.             (set #ArchiveError 0)
  108.             (set RunLhx
  109.                 (cat "Lhx -I -m e \"" ExpandName "\" \"" #UnpackDest "\"")
  110.             )
  111.  
  112.             (set #ArchiveError (run RunLhx))
  113.             (if (> #ArchiveError 0)
  114.             (
  115.                 (set #ArchiveAbortMsg (cat #ArchiveAbortMsg1 ExpandName "\""))
  116.                 (abort #ArchiveAbortMsg)
  117.             )
  118.         )
  119.     )
  120. )
  121.  
  122.  
  123. (Procedure @FormatDisk
  124.     (
  125.         (working #FormatWorkingMsgQuick)
  126.  
  127.         (set #FormatName (cat "\"" #FormatDiskName "\""))
  128.  
  129.         (set #FormatCheck
  130.             (run ("Format drive=df0: name=%s FFS QUICK NOICONS" #FormatName))
  131.         )
  132.  
  133.         (if (OR (> #FormatCheck 0) (< #FormatCheck 0))
  134.             (
  135.                 (working #FormatWorkingMsgSlow)
  136.  
  137.                 (set #FormatCheck
  138.                     (run ("Format drive=df0: name=%s FFS NOICONS" #FormatName))
  139.                 )
  140.  
  141.                 (if (OR (> #FormatCheck 0) (< #FormatCheck 0))
  142.                     (set #NoError 1)
  143.                     (set #NoError 0)
  144.                 )
  145.             )
  146.             (set #NoError 0)
  147.         )
  148.     )
  149. )
  150.  
  151.  
  152. (Procedure @GetOrganiserDrawer
  153.     (
  154.         ;** Find default drawer
  155.         (set #DefaultDest (getassign "Work" "d"))
  156.         (if (= #DefaultDest "")
  157.           (
  158.             (set #DefaultDest (getassign "HD3" "d"))
  159.             (if (= #DefaultDest "")
  160.               (
  161.               (set #DefaultDest (getassign "HD2" "d"))
  162.               (if (= #DefaultDest "")
  163.                     (
  164.                 (set #DefaultDest (getassign "HD1" "d"))
  165.                 (if (= #DefaultDest "")
  166.                   (
  167.                     (set #DefaultDest (getassign "DH1" "d"))
  168.                     (if (= #DefaultDest "")
  169.                     (
  170.                       (set #DefaultDest (getassign "HD0" "d"))
  171.                       (if (= #DefaultDest "")
  172.                         (
  173.                         (set #DefaultDest "DH0:")
  174.                         )
  175.                       )
  176.                     )
  177.                     )
  178.                   )
  179.                 )
  180.                 )
  181.               )
  182.             )
  183.             )
  184.           )
  185.         )
  186.  
  187.         ;** Ask for destination
  188.         (set #DestDrawer
  189.             (askdir
  190.                 (prompt #HardDiskDestChoiceMsg)
  191.                 (help #HardDiskDestChoiceHelp)
  192.                 (default #DefaultDest)
  193.             )
  194.         )
  195.     )
  196. )
  197.  
  198.  
  199. (Procedure @InstallToHardDisk
  200.     (
  201.         (@GetOrganiserDrawer)
  202.  
  203.         (makedir (tackon #DestDrawer "96 Plus Pack Themes"))
  204.         (makedir (tackon #DestDrawer "96 Plus Pack Supplements" ))
  205.  
  206.         (set #UnpackFile "96PlusPackInstall:Archive/Supps1.lha")
  207.         (set #UnpackDest (tackon #DestDrawer "96 Plus Pack Supplements/"))
  208.         (set #ArchiveType "Supplements")
  209.         (@UnpackFiles)
  210.  
  211.         (set #UnpackFile "96PlusPackInstall:Archive/Supps2.lha")
  212.         (set #UnpackDest (tackon #DestDrawer "96 Plus Pack Supplements/"))
  213.         (set #ArchiveType "Supplements")
  214.         (@UnpackFiles)
  215.  
  216.         (set #UnpackFile "96PlusPackInstall:Archive/Themes.lha")
  217.         (set #UnpackDest (tackon #DestDrawer "96 Plus Pack Themes/"))
  218.         (set #ArchiveType "Diary Themes")
  219.         (@UnpackFiles)
  220.  
  221.         (copyfiles
  222.             (source "96PlusPackInstall:Icons/")
  223.             (dest #DestDrawer)
  224.             (pattern ("(96 Plus Pack Supplements.info|96 Plus Pack Themes.info)"))
  225.             (optional "force")
  226.         )
  227.     )
  228. )
  229.  
  230.  
  231. (Procedure @InstallToFloppy
  232.     (
  233.         ;// Format first disk
  234.  
  235.         (message #BlankDiskWarning (help #FloppyWarningHelp))
  236.  
  237.         (set #NoError 1)
  238.         (while (= #NoError 1)
  239.             (
  240.                 (run "Wait 4")  ; Wait a bit for disk access to stop
  241.  
  242.                 (set #NoError 1)
  243.                 (set #FormatDiskName "96PlusPack-1")
  244.                 (@FormatDisk)
  245.                 (if (= #NoError 1)
  246.                     (message #FormatError (help #FormatErrorHelp))
  247.                 )
  248.                 )
  249.         )
  250.  
  251.         (makedir "96PlusPack-1:96 Plus Pack Supplements")
  252.         (makedir "96PlusPack-1:96 Plus Pack Themes")
  253.  
  254.         (message (cat #FormatDiskName #FormatCompleteMsg1 #FormatDiskName  #FormatCompleteMsg2))
  255.  
  256.  
  257.         ;// Format second disk
  258.  
  259.         (message #BlankDiskWarning (help #FloppyWarningHelp))
  260.  
  261.         (set #NoError 1)
  262.         (while (= #NoError 1)
  263.             (
  264.                 (run "Wait 4")  ; Wait a bit for disk access to stop
  265.  
  266.                 (set #NoError 1)
  267.                 (set #FormatDiskName "96PlusPack-2")
  268.                 (@FormatDisk)
  269.                 (if (= #NoError 1)
  270.                     (message #FormatError (help #FormatErrorHelp))
  271.                 )
  272.                 )
  273.         )
  274.  
  275.         (makedir "96PlusPack-2:96 Plus Pack Supplements" (infos))
  276.  
  277.         (message (cat #FormatDiskName #FormatCompleteMsg1 #FormatDiskName  #FormatCompleteMsg2))
  278.  
  279.  
  280.         ;// Make first disk
  281.  
  282.         (askdisk
  283.             (prompt (cat #InsertDiskMsg "96PlusPackInstall" "\""))
  284.             (help #DiskHelp)
  285.             (dest "96PlusPackInstall")
  286.         )
  287.  
  288.         (makedir "Ram:Archive")
  289.         (makedir "Ram:Icons")
  290.  
  291.         (copyfiles
  292.             (source "96PlusPackInstall:Archive/")
  293.             (dest "Ram:Archive")
  294.             (pattern ("(Supps1.lha|Themes.lha)"))
  295.             (optional "force")
  296.         )
  297.  
  298.         (copyfiles
  299.             (source "96PlusPackInstall:Icons/")
  300.             (dest "Ram:Icons")
  301.             (all)
  302.             (optional "force")
  303.         )
  304.  
  305.         (askdisk
  306.             (prompt (cat #InsertDiskMsg "96PlusPack-1" "\""))
  307.             (help #DiskHelp)
  308.             (dest "96PlusPack-1")
  309.         )
  310.  
  311.         (set #UnpackFile "Ram:Archive/Supps1.lha")
  312.         (set #UnpackDest "96PlusPack-1:96 Plus Pack Supplements/")
  313.         (set #ArchiveType "Supplements")
  314.         (@UnpackFiles)
  315.         
  316.         (run "delete Ram:Archive/Supps1.lha")
  317.  
  318.         (set #UnpackFile "Ram:Archive/Themes.lha")
  319.         (set #UnpackDest "96PlusPack-1:96 Plus Pack Themes/")
  320.         (set #ArchiveType "Diary Themes")
  321.         (@UnpackFiles)
  322.  
  323.         (copyfiles
  324.             (source "Ram:Icons/")
  325.             (dest "96PlusPack-1:")
  326.             (pattern ("96 Plus Pack Themes.info"))
  327.             (optional "force")
  328.         )        
  329.  
  330.         (copyfiles
  331.             (source "Ram:Icons/disk1")
  332.             (dest "96PlusPack-1:")
  333.             (all)
  334.             (optional "force")
  335.         )        
  336.  
  337.         (run "delete Ram:Archive/Themes.lha")
  338.  
  339.         (askdisk
  340.             (prompt (cat #InsertDiskMsg "96PlusPackInstall" "\""))
  341.             (help #DiskHelp)
  342.             (dest "96PlusPackInstall")
  343.         )
  344.  
  345.         (copyfiles
  346.             (source "96PlusPackInstall:Archive/")
  347.             (dest "Ram:Archive")
  348.             (pattern ("Supps2.lha"))
  349.             (optional "force")
  350.         )
  351.  
  352.         (askdisk
  353.             (prompt (cat #InsertDiskMsg "96PlusPack-2" "\""))
  354.             (help #DiskHelp)
  355.             (dest "96PlusPack-2")
  356.         )
  357.  
  358.         (set #UnpackFile "Ram:Archive/Supps2.lha")
  359.         (set #UnpackDest "96PlusPack-2:96 Plus Pack Supplements/")
  360.         (set #ArchiveType "Supplements")
  361.         (@UnpackFiles)
  362.  
  363.         (copyfiles
  364.             (source "Ram:Icons/disk2")
  365.             (dest "96PlusPack-2:")
  366.             (optional "force")
  367.             (all)
  368.         )        
  369.  
  370.         (run "delete Ram:Archive/Supps2.lha")
  371.         (run "delete Ram:Archive")
  372.         (run "delete Ram:Icons/#?")
  373.         (run "delete Ram:Icons")
  374.     )
  375. )
  376.  
  377.  
  378.  
  379. ;--------------------------------
  380. ; Start here!
  381. ;--------------------------------
  382.  
  383. (message #Welcome-Message)
  384.  
  385.     (run "resident 96PlusPackInstall:Utils/Format")
  386.     (run "resident 96PlusPackInstall:Utils/lhx")
  387.     (run "resident 96PlusPackInstall:Utils/Wait")
  388.     (run "resident 96PlusPackInstall:Utils/Delete")
  389.  
  390.     ;// Floppy or HD ?
  391.     (set #FullPath (expandpath "sys:"))
  392.  
  393.     (if (= #FullPath "Organiser:")
  394.         (set #DiskDefault 1)
  395.         (set #DiskDefault 0)
  396.     )
  397.  
  398.     (set #DestinationType
  399.         (askchoice
  400.             (prompt #DestChoicePrompt)
  401.             (choices #HardDiskChoiceMsg
  402.                  #FloppyChoiceMsg
  403.             )
  404.             (help #DestChoiceHelp)
  405.             (default #DiskDefault)
  406.         )
  407.     )
  408.  
  409.     (if (= #DestinationType 0)
  410.         (@InstallToHardDisk)
  411.         (@InstallToFloppy)
  412.     )
  413.  
  414.     (run "resident Format Remove")
  415.     (run "resident lhx Remove")
  416.     (run "resident Wait Remove")
  417.     (run "resident Delete Remove")
  418.  
  419.  
  420. (exit "\nFor details of how to use the Supplements and Diary Themes with Digita Organiser, refer to the the Organiser manual, or Organiser's on-line help system.")